<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // function fn1(a, b) {
        //     return a + b;
        // }
        // console.log(fn1(2, 3));
        // let fn = (a, b) => a + b;
        // console.log(fn(2, 4));

        var scope = "global"; //声明一个全局变量
        function checkscope() {
            var scope = "local"; //声明一个同名的局部变量
            return scope; //返回局部变量的值
        }
        console.log(checkscope()); //local
    </script>
</body>

</html>